<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script type="text/javascript" src="./js/jquery-1.7.1.js"></script>
	<script type="text/javascript" src="./js/jqueryUtil/jpage.js"></script>
	<link type="text/css" rel="stylesheet" href="./util/css/jpage.css"/>
</head>

<script>
$(function() {
  	init();

  	$('#reSet').click(function() {
  		init();
  	});
});
	
function init() {
	 $.post('json/home!jsonPage.action', function(data) {
	  	var ul = $('#itemContainer');
	  	ul.html('');
	  	$.each(eval("("+data+")").userInfo, function(index, value) {
		  	$('<li></li>').append(value.loginId).appendTo(ul);
	  	});
	  	$("div.holder").jPages({
	       	containerID: "itemContainer",
			previous: '上一頁', 
			next: '下一頁', 
			perPage: 5
		});
	 });
}  
</script>

<body>
	<button id="reSet">重新整理</button>
	<!-- navigation holder -->
	<div class="holder">
	</div>

	<!-- item container -->
	<ul id="itemContainer">
	</ul>

	<!-- navigation holder -->
	<div class="holder">
</div>
</body>
</html>